package com.owc.common.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

public enum VersionStatusEnum {
    NO_UPDATE(0,"无需更新"),
    NEED_UPDATE(1,"需要更新");

    VersionStatusEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    @Getter
    private Integer type;

    @Getter
    private String desc;

    public static Optional<VersionStatusEnum> match(Integer type){
        return Arrays.stream(VersionStatusEnum.values())
                .filter(t -> t.getType().equals(type))
                .findFirst();
    }
}
